<?php
class VB_Pages extends VB_Db_Table {
	protected $_name = 'vb_page';
	protected $_primary = 'page_id';

	protected $_rowClass = 'VB_Page';
	
	protected $_referenceMap = array(
		'Layout' => array(
			'columns' => 'layout_id',
			'refTableClass' => 'VB_Layouts',
			'refColumns' => 'layout_id',
		)
	);
	
	public function findByUrltitle($urltitle) {
		$query = $this->select();
		$query->where('page_urltitle = ?', $urltitle);
		return $this->fetchRow($query);
	}
}
new VB_Page();